package com.ncst.newsfragment;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.ncst.coursecode.R;

public class NewsContentFragment extends Fragment {
    private View view;
    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view=inflater.inflate(R.layout.news_content_frag,container,false);
        return view;
    }
    public void refresh(String newsTitle, String newsContent){
        View visibilityLayout=view.findViewById(R.id.news_content_layout);
        visibilityLayout.setVisibility(View.VISIBLE);
        ((TextView) view.findViewById(R.id.news_title)).setText(newsTitle);
        ((TextView) view.findViewById(R.id.news_content)).setText(newsContent);
    }


}
